package com.ruoyi.xst.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.xst.mapper.HardwareMapper;
import com.ruoyi.xst.domain.Hardware;
import com.ruoyi.xst.service.IHardwareService;

/**
 * 门牌Service业务层处理
 * 
 * @author Rambo
 * @date 2024-11-21
 */
@Service
public class HardwareServiceImpl implements IHardwareService 
{
    @Autowired
    private HardwareMapper hardwareMapper;

    /**
     * 查询门牌
     * 
     * @param id 门牌主键
     * @return 门牌
     */
    @Override
    public Hardware selectHardwareById(Long id)
    {
        return hardwareMapper.selectHardwareById(id);
    }

    /**
     * 查询门牌列表
     * 
     * @param hardware 门牌
     * @return 门牌
     */
    @Override
    public List<Hardware> selectHardwareList(Hardware hardware)
    {
        return hardwareMapper.selectHardwareList(hardware);
    }

    /**
     * 新增门牌
     * 
     * @param hardware 门牌
     * @return 结果
     */
    @Override
    public int insertHardware(Hardware hardware)
    {
        hardware.setCreateTime(DateUtils.getNowDate());
        return hardwareMapper.insertHardware(hardware);
    }

    /**
     * 修改门牌
     * 
     * @param hardware 门牌
     * @return 结果
     */
    @Override
    public int updateHardware(Hardware hardware)
    {
        hardware.setUpdateTime(DateUtils.getNowDate());
        return hardwareMapper.updateHardware(hardware);
    }

    /**
     * 批量删除门牌
     * 
     * @param ids 需要删除的门牌主键
     * @return 结果
     */
    @Override
    public int deleteHardwareByIds(Long[] ids)
    {
        return hardwareMapper.deleteHardwareByIds(ids);
    }

    /**
     * 删除门牌信息
     * 
     * @param id 门牌主键
     * @return 结果
     */
    @Override
    public int deleteHardwareById(Long id)
    {
        return hardwareMapper.deleteHardwareById(id);
    }
}
